package com.day12;

interface Jumpping{
    void jump();
}
class JumppingOperator{
    public void useJumpping(Jumpping j){
        j.jump();
    }
    public Jumpping getJumpping(){
        Jumpping j = new Cat();
        return j;
    }
}
class Cat implements Jumpping{
    public void jump(){
        System.out.println("猫跳起来");
    }
}
public class JumppingDemo {
    public static void main(String[] args){
        JumppingOperator jo=new JumppingOperator();
        Jumpping j=new Cat();
        jo.useJumpping(j);
        Jumpping j2=jo.getJumpping();
        j2.jump();
    }
}
